package org.springcloud.wisdom.springcloud_03_freshman.student.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;
import org.springcloud.wisdom.springcloud_03_freshman.index.login.entity.Student;

@Mapper
public interface StudentDao {
    //根据id更新学生表中的数据
    @Update("<script>" +
            "update student" +
            "        <set>" +
            "            <if test=\"null!= address\">" +
            "                address =#{address}," +
            "            </if>" +
            "            <if test=\"null!= email\">" +
            "                email =#{email}," +
            "            </if>" +
            "            <if test=\"null!= phone\">" +
            "                phone =#{phone}," +
            "            </if>" +
            "        </set>" +
            "        where sid =#{sid}" +
            "</script>")
    public  int  updateStudentBySid(Student student);
}
